﻿namespace HiMap.MapControls
{
    using HiMap.Carto;
    using HiMap.Geometry;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    public class DrawControl : UserControl
    {
        private Color _DisplayColor;
        private Color _DrawColor;
        private PicType _DrawType;
        private bool _EdgeMonitor;
        private Image _ImgClone;
        private IFeature _isEditFeature;
        private MapControl _Map;
        private State _state;
        private ButtonInfo BottomLeftInfo;
        private ButtonInfo BottomRightInfo;
        private IContainer components;
        private List<Control> controls;
        private bool IsMove;
        private bool isMoveScreen;
        private List<Point> listDisplayPts;
        private List<IPoint> listMapPts;
        private PicCtrl MePic;
        private int MoveX;
        private int MoveY;
        private PictureBox picBottomLeft;
        private PictureBox picBottomRight;
        private PictureBox picMove;
        private PictureBox picTopLeft;
        private PictureBox picTopRight;
        private ButtonInfo TopLeftInfo;
        private ButtonInfo TopRightInfo;

        public event AfterAddPointEvent AfterAddPoint;

        public event EventHandler BottomLeft_Click;

        public event EventHandler BottomRight_Click;

        public event EventHandler TopLeft_Click;

        public event EventHandler TopRight_Click;

        public DrawControl()
        {
            this.InitializeComponent();
            this.controls = new List<Control>();
            this.Location = new Point(0, 0);
            this._DisplayColor = Color.Red;
            this._DrawColor = Color.Red;
            this._ImgClone = null;
            Image image = Image.FromHbitmap(new Bitmap(base.Width, base.Height).GetHbitmap());
            Graphics g = Graphics.FromImage(image);
            g.Clear(Color.White);
            this.DrawTags(g);
            this.picMove.Image = image;
            this.IsMove = false;
            this.MoveX = -1;
            this.MoveY = -1;
            this.listDisplayPts = new List<Point>();
            this.listMapPts = new List<IPoint>();
            this.TopLeftInfo = new ButtonInfo();
            this.TopRightInfo = new ButtonInfo();
            this.BottomLeftInfo = new ButtonInfo();
            this.BottomRightInfo = new ButtonInfo();
            this.EdgeMonitor = false;
            this.MePic = null;
            this.IniButtons();
            this.AfterAddPoint = (AfterAddPointEvent) Delegate.Combine(this.AfterAddPoint, new AfterAddPointEvent(this.OnAfterAddPoint));
        }

        private void AddPoint(Point pt)
        {
            this.IniMePic();
            this.listDisplayPts.Add(pt);
            this.listMapPts.Add(this.Map.PointToMapPoint(pt.X, pt.Y));
            this.MePic.CreatePic(pt.X, pt.Y);
            this.MePic.Draw();
            base.BringToFront();
            this.Show(new Point(pt.X - (base.Width / 2), pt.Y - (base.Height / 2)));
            this.AfterAddPoint(this.listMapPts.get_Item(this.listMapPts.get_Count() - 1), this.listDisplayPts.get_Item(this.listDisplayPts.get_Count() - 1));
        }

        public void ClearDraw()
        {
            if (this.MePic != null)
            {
                this.MePic.Clear(false);
                this.listDisplayPts.Clear();
                this.listMapPts.Clear();
            }
        }

        public void ControlDispose()
        {
            if (this.picMove.Image != null)
            {
                this.picMove.Image.Dispose();
            }
            if (this.picTopLeft.Image != null)
            {
                this.picTopLeft.Image.Dispose();
            }
            if (this.picTopRight.Image != null)
            {
                this.picTopRight.Image.Dispose();
            }
            if (this.picBottomLeft.Image != null)
            {
                this.picBottomLeft.Image.Dispose();
            }
            if (this.picBottomRight.Image != null)
            {
                this.picBottomRight.Image.Dispose();
            }
            if (this.Map != null)
            {
                for (int i = 0; i < this.controls.get_Count(); i++)
                {
                    this.Map.Controls.Remove(this.controls.get_Item(i));
                }
            }
            if (this.MePic != null)
            {
                this.MePic.Dispose();
            }
        }

        public void CreatePoint(Point pt)
        {
            this.AddPoint(pt);
        }

        private void CreateUIPts()
        {
            IGeometry geometry = null;
            IPointCollection points = null;
            switch (this._isEditFeature.Shape.Type)
            {
                case GeometryType.Point:
                {
                    IPoint shape = (IPoint) this._isEditFeature.Shape;
                    this.CreatePoint(this._Map.MapToScreen(shape.X, shape.Y));
                    break;
                }
                case GeometryType.Polyline:
                    geometry = this._isEditFeature.Shape;
                    break;

                case GeometryType.Polygon:
                    geometry = this._isEditFeature.Shape;
                    break;
            }
            if (geometry != null)
            {
                IPoint point = null;
                points = (IPointCollection) geometry;
                for (int i = 0; i < points.PointCount; i++)
                {
                    point = points.GetPoint(i);
                    this.CreatePoint(this._Map.MapToScreen(point.X, point.Y));
                }
            }
            this.Location = new Point(this.listDisplayPts.get_Item(this.listDisplayPts.get_Count() - 1).X - (base.Width / 2), this.listDisplayPts.get_Item(this.listDisplayPts.get_Count() - 1).Y - (base.Height / 2));
            this.MoveButtons();
        }

        public void DeletePoint(int index)
        {
            bool flag = false;
            if ((this.listDisplayPts.get_Count() - 1) == index)
            {
                flag = true;
            }
            if (this.MePic != null)
            {
                this.MePic.Delete(index);
            }
            if (flag && (this.listDisplayPts.get_Count() > 0))
            {
                Point point = this.listDisplayPts.get_Item(this.listDisplayPts.get_Count() - 1);
                this.MePic.Draw();
                this.Location = new Point(point.X - (base.Width / 2), point.Y - (base.Height / 2));
                this.MoveButtons();
                this.Show(this.Location);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void DrawStop(bool isSave, out List<IPoint> MapPoints, out List<Point> DisplayPoints)
        {
            MapPoints = new List<IPoint>();
            DisplayPoints = new List<Point>();
            if ((this.Img != null) && (this.MePic != null))
            {
                this.MePic.Clear(isSave);
                for (int i = 0; i < this.listMapPts.get_Count(); i++)
                {
                    IPoint point = new PointClass();
                    point.X = this.listMapPts.get_Item(i).X;
                    point.Y = this.listMapPts.get_Item(i).Y;
                    MapPoints.Add(point);
                }
                for (int j = 0; j < this.listDisplayPts.get_Count(); j++)
                {
                    Point point2 = new Point(this.listDisplayPts.get_Item(j).X, this.listDisplayPts.get_Item(j).Y);
                    DisplayPoints.Add(point2);
                }
                this.Show(this.Location);
                this.listDisplayPts.Clear();
                this.listMapPts.Clear();
            }
        }

        private void DrawTags(Graphics g)
        {
            g.DrawLine(new Pen(this.DisplayColor, 1f), 0, base.Height / 2, base.Width, base.Height / 2);
            g.DrawLine(new Pen(this.DisplayColor, 1f), base.Width / 2, 0, base.Width / 2, base.Height);
        }

        private void EditControl_Resize(object sender, EventArgs e)
        {
            base.Size = new Size(40, 40);
        }

        private void IniButtons()
        {
            this.picTopLeft = new PictureBox();
            this.picTopRight = new PictureBox();
            this.picBottomLeft = new PictureBox();
            this.picBottomRight = new PictureBox();
            this.picTopLeft.Visible = false;
            this.picTopRight.Visible = false;
            this.picBottomLeft.Visible = false;
            this.picBottomRight.Visible = false;
            this.picTopLeft.Enabled = false;
            this.picTopRight.Enabled = false;
            this.picBottomLeft.Enabled = false;
            this.picBottomRight.Enabled = false;
            this.picTopLeft.Size = new Size(0x10, 0x10);
            this.picTopRight.Size = new Size(0x10, 0x10);
            this.picBottomLeft.Size = new Size(0x10, 0x10);
            this.picBottomRight.Size = new Size(0x10, 0x10);
            this.picTopLeft.SizeMode = PictureBoxSizeMode.StretchImage;
            this.picTopRight.SizeMode = PictureBoxSizeMode.StretchImage;
            this.picBottomLeft.SizeMode = PictureBoxSizeMode.StretchImage;
            this.picBottomRight.SizeMode = PictureBoxSizeMode.StretchImage;
            this.picTopLeft.Click += new EventHandler(this.picTopLeft_Click);
            this.picTopRight.Click += new EventHandler(this.picTopRight_Click);
            this.picBottomLeft.Click += new EventHandler(this.picBottomLeft_Click);
            this.picBottomRight.Click += new EventHandler(this.picBottomRight_Click);
            this.TopLeft_Click = (EventHandler) Delegate.Combine(this.TopLeft_Click, new EventHandler(this.OnTopLeft_Click));
            this.TopRight_Click = (EventHandler) Delegate.Combine(this.TopRight_Click, new EventHandler(this.OnTopRight_Click));
            this.BottomLeft_Click = (EventHandler) Delegate.Combine(this.BottomLeft_Click, new EventHandler(this.OnBottomLeft_Click));
            this.BottomRight_Click = (EventHandler) Delegate.Combine(this.BottomRight_Click, new EventHandler(this.OnBottomRight_Click));
        }

        private void IniMePic()
        {
            if (this.MePic == null)
            {
                if (this.Map != null)
                {
                    this.MePic = new PicCtrl(this.Map, this.listMapPts, this.listDisplayPts, this.DrawType);
                    this.MePic.DrawColor = this.DrawColor;
                }
                else
                {
                    this.MePic = null;
                }
            }
        }

        private void InitializeComponent()
        {
            this.picMove = new PictureBox();
            base.SuspendLayout();
            this.picMove.BackColor = Color.White;
            this.picMove.Dock = DockStyle.Fill;
            this.picMove.Location = new Point(0, 0);
            this.picMove.Name = "picMove";
            this.picMove.Size = new Size(40, 40);
            this.picMove.MouseMove += new MouseEventHandler(this.picMove_MouseMove);
            this.picMove.MouseDown += new MouseEventHandler(this.picMove_MouseDown);
            this.picMove.MouseUp += new MouseEventHandler(this.picMove_MouseUp);
            base.set_AutoScaleMode(3);
            base.Controls.Add(this.picMove);
            base.Name = "DrawControl";
            base.Size = new Size(40, 40);
            base.Resize += new EventHandler(this.EditControl_Resize);
            base.ResumeLayout(false);
        }

        public void InsertPoint(int index, double x, double y)
        {
            if (index >= 0)
            {
                IPoint point = new PointClass();
                point.X = x;
                point.Y = y;
                this.listMapPts.Insert(index, point);
                this.listDisplayPts.Insert(index, this.Map.MapToScreen(x, y));
                this.MePic.InsertPic(index, this.Map.MapToScreen(x, y).X, this.Map.MapToScreen(x, y).Y);
                this.MePic.Draw();
                base.BringToFront();
                this.Show(this.Location);
            }
        }

        public void InsertPoint(int index, int x, int y)
        {
            if (index >= 0)
            {
                this.listDisplayPts.Insert(index, new Point(x, y));
                this.listMapPts.Insert(index, this.Map.PointToMapPoint(x, y));
                this.MePic.InsertPic(index, x, y);
                this.MePic.Draw();
                base.BringToFront();
                this.Show(this.Location);
            }
        }

        private void MoveButtons()
        {
            try
            {
                if ((((this.picTopLeft != null) && (this.picTopRight != null)) && (this.picBottomLeft != null)) && (this.picBottomRight != null))
                {
                    this.picTopLeft.BackColor = this.DisplayColor;
                    this.picTopLeft.Location = new Point(this.Location.X - (this.picTopLeft.Size.Width / 2), this.Location.Y - (this.picTopLeft.Size.Height / 2));
                    this.picTopLeft.BringToFront();
                    this.picTopRight.BackColor = this.DisplayColor;
                    this.picTopRight.Location = new Point((this.Location.X + base.Width) - (this.picTopRight.Size.Width / 2), this.Location.Y - (this.picTopRight.Size.Height / 2));
                    this.picTopRight.BringToFront();
                    this.picBottomLeft.BackColor = this.DisplayColor;
                    this.picBottomLeft.Location = new Point(this.Location.X - (this.picBottomLeft.Size.Width / 2), (this.Location.Y + base.Height) - (this.picBottomLeft.Size.Height / 2));
                    this.picBottomLeft.BringToFront();
                    this.picBottomRight.BackColor = this.DisplayColor;
                    this.picBottomRight.Location = new Point((this.Location.X + base.Width) - (this.picBottomRight.Size.Width / 2), (this.Location.Y + base.Height) - (this.picBottomRight.Size.Height / 2));
                    this.picBottomRight.BringToFront();
                }
            }
            catch
            {
            }
        }

        public void MovePoint(int index, double x, double y)
        {
            if ((index >= 0) && (this.listMapPts.get_Count() > index))
            {
                IPoint point = new PointClass();
                point.X = x;
                point.Y = y;
                this.listMapPts.set_Item(index, point);
                this.listDisplayPts.set_Item(index, this.Map.MapToScreen(x, y));
                this.MePic.MovePic(index);
            }
        }

        public void MovePoint(int index, int x, int y)
        {
            if ((index >= 0) && (this.listDisplayPts.get_Count() > index))
            {
                this.listDisplayPts.set_Item(index, new Point(x, y));
                this.listMapPts.set_Item(index, this.Map.PointToMapPoint(x, y));
                this.MePic.MovePic(index);
            }
        }

        private bool MoveScreen()
        {
            bool flag = false;
            if (this.EdgeMonitor)
            {
                IPoint point;
                List<IPoint> mapPoints;
                List<Point> displayPoints;
                IPoint centerAt = this.Map.Map.CenterAt;
                IEnvelope envelope = this.Map.Map.Envelope;
                if (this.Location.X < 0)
                {
                    point = new PointClass();
                    point = this.Map.PointToMapPoint(this.Map.Width / 4, 0);
                    this.Location = new Point(this.Map.Width / 4, this.Location.Y);
                    centerAt.X = point.X;
                    flag = true;
                }
                if (this.Location.Y < 0)
                {
                    point = new PointClass();
                    point = this.Map.PointToMapPoint(0, this.Map.Height / 4);
                    this.Location = new Point(this.Location.X, this.Map.Height / 4);
                    centerAt.Y = point.Y;
                    flag = true;
                }
                if ((this.Location.X + base.Width) > this.Map.Width)
                {
                    point = new PointClass();
                    point = this.Map.PointToMapPoint((this.Map.Width / 4) * 3, 0);
                    this.Location = new Point((this.Map.Width / 4) * 3, this.Location.Y);
                    centerAt.X = point.X;
                    flag = true;
                }
                if ((this.Location.Y + base.Height) > this.Map.Height)
                {
                    point = new PointClass();
                    point = this.Map.PointToMapPoint(0, (this.Map.Height / 4) * 3);
                    this.Location = new Point(this.Location.X, (this.Map.Height / 4) * 3);
                    centerAt.Y = point.Y;
                    flag = true;
                }
                if (!flag)
                {
                    return flag;
                }
                this.DrawStop(true, out mapPoints, out displayPoints);
                this.Map.Map.CenterAt = centerAt;
                this.Show(this.Location);
                this.Map.MapRefresh();
                this.Img = this.Map.MapImage;
                for (int i = 0; i < mapPoints.get_Count(); i++)
                {
                    this.CreatePoint(this.Map.MapToScreen(mapPoints.get_Item(i).X, mapPoints.get_Item(i).Y));
                }
            }
            return flag;
        }

        private void OnAfterAddPoint(IPoint MapPoint, Point DisplayPoint)
        {
        }

        private void OnBottomLeft_Click(object sender, EventArgs e)
        {
            if (!this.BottomLeftInfo.Selected)
            {
                this.picBottomLeft.Image = this.BottomLeftInfo.SelectedImage;
                this.BottomLeftInfo.Selected = true;
            }
            else
            {
                this.picBottomLeft.Image = this.BottomLeftInfo.Image;
                this.BottomLeftInfo.Selected = false;
            }
        }

        private void OnBottomRight_Click(object sender, EventArgs e)
        {
            if (!this.BottomRightInfo.Selected)
            {
                this.picBottomRight.Image = this.BottomRightInfo.SelectedImage;
                this.BottomRightInfo.Selected = true;
            }
            else
            {
                this.picBottomRight.Image = this.BottomRightInfo.Image;
                this.BottomRightInfo.Selected = false;
            }
        }

        private void OnTopLeft_Click(object sender, EventArgs e)
        {
            if (!this.TopLeftInfo.Selected)
            {
                this.picTopLeft.Image = this.TopLeftInfo.SelectedImage;
                this.TopLeftInfo.Selected = true;
            }
            else
            {
                this.picTopLeft.Image = this.TopLeftInfo.Image;
                this.TopLeftInfo.Selected = false;
            }
        }

        private void OnTopRight_Click(object sender, EventArgs e)
        {
            if (!this.TopRightInfo.Selected)
            {
                this.picTopRight.Image = this.TopRightInfo.SelectedImage;
                this.TopRightInfo.Selected = true;
            }
            else
            {
                this.picTopRight.Image = this.TopRightInfo.Image;
                this.TopRightInfo.Selected = false;
            }
        }

        private void picBottomLeft_Click(object sender, EventArgs e)
        {
            this.BottomLeft_Click(sender, e);
        }

        private void picBottomRight_Click(object sender, EventArgs e)
        {
            this.BottomRight_Click(sender, e);
        }

        private void picMove_MouseDown(object sender, MouseEventArgs e)
        {
            this.IniMePic();
            if ((this.Img != null) && (this.MePic != null))
            {
                this.IsMove = true;
                this.MoveX = e.X;
                this.MoveY = e.Y;
            }
            else
            {
                this.IsMove = false;
            }
        }

        private void picMove_MouseMove(object sender, MouseEventArgs e)
        {
            if ((e.Button != MouseButtons.None) && this.IsMove)
            {
                this.Map.Refresh();
                this.Location = new Point(this.Location.X + (e.X - this.MoveX), this.Location.Y + (e.Y - this.MoveY));
                this.isMoveScreen = this.MoveScreen();
                if (!this.isMoveScreen)
                {
                    this.Show(this.Location);
                }
                this.OnMouseMove(e);
            }
        }

        private void picMove_MouseUp(object sender, MouseEventArgs e)
        {
            this.IsMove = false;
            if (!this.isMoveScreen)
            {
                this.AddPoint(new Point(this.Location.X + (base.Width / 2), this.Location.Y + (base.Height / 2)));
            }
        }

        private void picTopLeft_Click(object sender, EventArgs e)
        {
            this.TopLeft_Click(sender, e);
        }

        private void picTopRight_Click(object sender, EventArgs e)
        {
            this.TopRight_Click(sender, e);
        }

        public void SelectedPoint(int index)
        {
            if (index >= 0)
            {
                this.MePic.Selected(index);
            }
        }

        public void SetButton(ButtonLocation Btn, bool isVisible, Image ButtonImg, Image ButtonSelectedImg)
        {
            PictureBox picTopLeft = null;
            switch (Btn)
            {
                case ButtonLocation.TopLeftButton:
                    this.TopLeftInfo.Selected = false;
                    this.TopLeftInfo.Image = ButtonImg;
                    this.TopLeftInfo.SelectedImage = ButtonSelectedImg;
                    picTopLeft = this.picTopLeft;
                    break;

                case ButtonLocation.TopRightButton:
                    this.TopRightInfo.Selected = false;
                    this.TopRightInfo.Image = ButtonImg;
                    this.TopRightInfo.SelectedImage = ButtonSelectedImg;
                    picTopLeft = this.picTopRight;
                    break;

                case ButtonLocation.BottomLeftButton:
                    this.BottomLeftInfo.Selected = false;
                    this.BottomLeftInfo.Image = ButtonImg;
                    this.BottomLeftInfo.SelectedImage = ButtonSelectedImg;
                    picTopLeft = this.picBottomLeft;
                    break;

                case ButtonLocation.BottomRightButton:
                    this.BottomRightInfo.Selected = false;
                    this.BottomRightInfo.Image = ButtonImg;
                    this.BottomRightInfo.SelectedImage = ButtonSelectedImg;
                    picTopLeft = this.picBottomRight;
                    break;
            }
            if (picTopLeft != null)
            {
                base.Parent.Controls.Add(picTopLeft);
                picTopLeft.Visible = isVisible;
                picTopLeft.Enabled = isVisible;
                picTopLeft.Image = ButtonImg;
                this.controls.Add(picTopLeft);
            }
        }

        public void Show(Point pt)
        {
            Graphics g = Graphics.FromImage(this.picMove.Image);
            if (this.Img != null)
            {
                g.DrawImage(this.Map.MapImage, new Rectangle(0, 0, base.Width, base.Height), new Rectangle(pt.X, pt.Y, base.Width, base.Height), GraphicsUnit.Pixel);
            }
            else
            {
                g.Clear(Color.White);
            }
            this.DrawTags(g);
            this.MoveButtons();
            this.picMove.Refresh();
        }

        public Color DisplayColor
        {
            get
            {
                return this._DisplayColor;
            }
            set
            {
                this._DisplayColor = value;
            }
        }

        public Color DrawColor
        {
            get
            {
                return this._DrawColor;
            }
            set
            {
                this._DrawColor = value;
            }
        }

        public PicType DrawType
        {
            get
            {
                return this._DrawType;
            }
            set
            {
                this._DrawType = value;
                if (this.MePic != null)
                {
                    this.MePic.picType = value;
                }
            }
        }

        public bool EdgeMonitor
        {
            get
            {
                return this._EdgeMonitor;
            }
            set
            {
                this._EdgeMonitor = value;
            }
        }

        public Image Img
        {
            get
            {
                return this._ImgClone;
            }
            set
            {
                if (value != null)
                {
                    this._ImgClone = (Image) value.Clone();
                    if (this.MePic != null)
                    {
                        this.MePic.Img = value;
                    }
                }
                else
                {
                    this._ImgClone = value;
                }
            }
        }

        public IFeature isEditFeature
        {
            get
            {
                return this._isEditFeature;
            }
            set
            {
                this._isEditFeature = value;
                this.ClearDraw();
                if (value == null)
                {
                    this.state = State.Create;
                }
                else
                {
                    this.state = State.Edit;
                    this.CreateUIPts();
                }
            }
        }

        public Point Location
        {
            get
            {
                return base.Location;
            }
            set
            {
                base.Location = value;
                this.MoveButtons();
            }
        }

        public MapControl Map
        {
            get
            {
                return this._Map;
            }
            set
            {
                this._Map = value;
                if (value == null)
                {
                    this.Img = null;
                }
                else
                {
                    this.Img = value.MapImage;
                }
            }
        }

        public List<Point> Pts
        {
            get
            {
                return this.listDisplayPts;
            }
        }

        private State state
        {
            get
            {
                return this._state;
            }
            set
            {
                this._state = value;
            }
        }

        public bool Visible
        {
            get
            {
                return base.Visible;
            }
            set
            {
                base.Visible = value;
                if (!value)
                {
                    if (this.picTopLeft.Enabled)
                    {
                        this.picTopLeft.Visible = false;
                    }
                    if (this.picTopRight.Enabled)
                    {
                        this.picTopRight.Visible = false;
                    }
                    if (this.picBottomLeft.Enabled)
                    {
                        this.picBottomLeft.Visible = false;
                    }
                    if (this.picBottomRight.Enabled)
                    {
                        this.picBottomRight.Visible = false;
                    }
                }
                else
                {
                    if (this.picTopLeft.Enabled)
                    {
                        this.picTopLeft.Visible = true;
                        this.picTopLeft.BringToFront();
                    }
                    if (this.picTopRight.Enabled)
                    {
                        this.picTopRight.Visible = true;
                        this.picTopRight.BringToFront();
                    }
                    if (this.picBottomLeft.Enabled)
                    {
                        this.picBottomLeft.Visible = true;
                        this.picBottomLeft.BringToFront();
                    }
                    if (this.picBottomRight.Enabled)
                    {
                        this.picBottomRight.Visible = true;
                        this.picBottomRight.BringToFront();
                    }
                }
            }
        }

        public delegate void AfterAddPointEvent(IPoint MapPoint, Point DisplayPoint);

        [StructLayout(LayoutKind.Sequential)]
        private struct ButtonInfo
        {
            public bool Selected;
            public System.Drawing.Image SelectedImage;
            public System.Drawing.Image Image;
        }

        private enum State
        {
            Create,
            Edit
        }
    }
}

